//
//  StringUtil.h
//  SZYH2
//
//  Created by ZZB on 13-7-18.
//  Copyright (c) 2013年 JMU. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface StringUtil : NSObject

/**
 * 判断字符串是否为空：nil, NULL, NSNull, @""
 */
+ (BOOL)isEmpty:(NSString *)string;
+ (BOOL)isNotEmpty:(NSString *)string;

/**
 * 是否正常日期的时间缀
 */
+ (BOOL)isDateNum:(double)num;
+ (BOOL)isNotDateNum:(double)num;

/**
 * 格式化数字为字符串
 */
+ (NSString *)valueOfInt:(int)value;
+ (NSString *)valueOfFloat:(float)value;
+ (NSString *)valueOfFloat:(float)value withPoint:(int)pointNum;
+ (NSString *)valueOfDouble:(double)value;
+ (NSString *)valueOfDouble:(double)value withPoint:(int)pointNum;

/**
 * 判断字符串strValue中是否包含有子字符串strKey，返回索引值
 */
+ (int)indexOf:(NSString *)strKey inString:(NSString *)string;

/**
 * 判断字符串strValue中是否包含 指定串的中任意一个字符
 */
+ (BOOL)containChars:(NSCharacterSet *)charset inString:(NSString *)string;

/**
 * 判断一个串是否包含key串
 *  @param key          查找的串
 *  @param string       源串
 *  @param ignoreCase   是否区分大小写
 */
+ (BOOL)containString:(NSString *)key inString:(NSString *)string ignoreCase:(BOOL)ignoreCase;

/**
 * 清除首尾指定字符
 */
+ (NSString *)trimHeadTail:(NSCharacterSet *)charset forString:(NSString *)string;

/**
 * 返回字符串MD5
 */
//+ (NSString *)md5:(NSString *)string;

+ (NSString *)domainFromEmail:(NSString *)email;


// 手机号码344/44格式转换
+ (NSString *)stringFormat334:(NSString *)mobile;
+ (NSString *)stringFormat44:(NSString *)mobile;

@end
